package light.head.model.el;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;
/**
 * 课程讲师关系表
 */
@Table
@Entity
public class CourseLecturer implements Serializable{
	
	
	private static final long serialVersionUID = -2838396758257819927L;
	
	private Integer code;
	private Integer cc;					// 课程编号
	private Integer lc;					// 讲师编号
	private Integer oc;					// 机构编号
	
	private String ln;
	private String ccn;
	private String on;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public Integer getCc() {
		return cc;
	}
	@Column
	public Integer getLc() {
		return lc;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Formula("(SELECT o.name FROM Organ o WHERE o.code = oc)")
	public String getOn() {
		return on;
	}
	@Formula("(SELECT l.ln FROM Lecturer l WHERE l.code = lc)")
	public String getLn() {
		return ln;
	}
	@Formula("(SELECT c.name FROM Course c WHERE c.code = cc)")
	public String getCcn() {
		return ccn;
	}
	
	
	
	
	
	
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setOn(String on) {
		this.on = on;
	}
	public void setCc(Integer cc) {
		this.cc = cc;
	}
	public void setLc(Integer lc) {
		this.lc = lc;
	}
	public void setLn(String ln) {
		this.ln = ln;
	}
	public void setCcn(String ccn) {
		this.ccn = ccn;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	

}
